; ARP Packet Sender for POSx86
;Copyright (c) 2009, 2010 Max Reitz
;
;Permission is hereby granted,  free of charge,  to any  person obtaining a
;copy of this software and associated documentation files (the "Software"),
;to deal in the Software without restriction,  including without limitation
;the rights to use,  copy, modify, merge, publish,  distribute, sublicense,
;and/or sell copies  of the  Software,  and to permit  persons to whom  the
;Software is furnished to do so, subject to the following conditions:
;
;The above copyright notice and this permission notice shall be included in
;all copies or substantial portions of the Software.
;
;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;IMPLIED, INCLUDING  BUT NOT  LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;FITNESS FOR A PARTICULAR  PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL
;THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;LIABILITY,  WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE,  ARISING
;FROM,  OUT OF  OR IN CONNECTION  WITH THE  SOFTWARE  OR THE  USE OR  OTHER
;DEALINGS IN THE SOFTWARE.
;
; This module is incomplete :(
ARP_SEND:
	call INITIALIZE_PCI ; Initialize the ARP Driver with
	; proper args
	; Reach the COMMAND Reg
	add dx,0x31
	; Reset the Realtek NIC
	mov al,0x10
	out dx,al
.WAIT:
	; Wait for Reset
	in al,dx
	jnz .WAIT ; If the card has not yet undergone
	; a reset then wait again!
	; Or Activate the Transmission!
	jmp .ACTIVATE
.ACTIVATE:
	mov al,0x0C
	out dx,al
	; Transmission CONFIG Register
	add dx,0x09
	; Read it
	in eax,dx
	; Take those bits
	and   eax,0x7FC00000
	; DMA (2KB Transfer)
	or  ax,0x0700
	out dx,eax
	;Go to RECEIVE CONFIG register
	add   dx,0x04
	; Unlimited DMA, broadcast + multicast + singlecast (no promiscuous)
	mov   eax,0x0000070D
	out   dx,eax
	; Go to RECEIVE BUFFER register
	sub   dx,0x14
	; Enter the address of our receive buffer here
	mov   eax,RECEIVE_BUFFER
	out   dx,eax
	;Go to INTERRUPT MASK register
	add   dx,0x0C
	;Disable all interrupts
	xor   ax,ax
	out   dx,ax
	call  WAIT_BIT
	; We are going to "broadcast" our packet, i.e. Send it to everyone
	
